Skip to content

libsyntax: improve error message for lifetimes in patterns #29287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 26, 2015

Conversation

Ryman
Copy link
Contributor

@Ryman Ryman commented Oct 25, 2015

Previously, if you copied a signature from a trait definition such as:

fn foo<'a>(&'a Bar) -> bool {}

and moved it into an impl, there would be an error message:

"unexpected token 'a"

Adding to the error message that a pattern is expected should help
users to find the actual problem with using a lifetime here.

Ryman added 3 commits October 25, 2015 01:28
Previously, if you copied a signature from a trait definition such as:

```
fn foo<'a>(&'a Bar) -> bool {}
```

and moved it into an `impl`, there would be an error message:

"unexpected token `'a`"

Adding to the error message that a pattern is expected should help
users to find the actual problem with using a lifetime here.
@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+ 1a23527

Thanks @Ryman!

@bors
Copy link
Collaborator

bors commented Oct 26, 2015

⌛ Testing commit 1a23527 with merge 278cc2f...

bors added a commit that referenced this pull request Oct 26, 2015
Previously, if you copied a signature from a trait definition such as:

```rust
fn foo<'a>(&'a Bar) -> bool {}
```

and moved it into an `impl`, there would be an error message:

"unexpected token `'a`"

Adding to the error message that a pattern is expected should help
users to find the actual problem with using a lifetime here.
@bors bors merged commit 1a23527 into rust-lang:master Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants